#include "ClientDisconnectedNetworkEvent.h"
#include "LobbyState.h"
#include "ClientMenuState.h"

ClientDisconnectedNetworkEvent::ClientDisconnectedNetworkEvent()
{
}

ClientDisconnectedNetworkEvent::ClientDisconnectedNetworkEvent(const Header& header)
{
    message.header = header;
}

ClientDisconnectedNetworkEvent::~ClientDisconnectedNetworkEvent()
{
}

GameState* ClientDisconnectedNetworkEvent::visitLobbyState(LobbyState* lobbyState) const
{
    return lobbyState->handleClientDisconnectedEvent(message.header.playerId);
}

GameState* ClientDisconnectedNetworkEvent::visitClientMenuState(ClientMenuState* clientMenuState) const
{
    return clientMenuState->handleClientDisconnectedEvent();
}

void* ClientDisconnectedNetworkEvent::getMessageBlob()
{
    return &message;
}

size_t ClientDisconnectedNetworkEvent::getMessageBlobSize()
{
    return sizeof(message);
}
